package com.huawei.struts.service.imp;

import java.util.List;

import com.huawei.struts.dao.LjwChannelTDAO;
import com.huawei.struts.exception.SystemException;
import com.huawei.struts.service.IChannelService;
import com.huawei.struts.util.PageBean;
import com.st.model.LjwChannelT;

public class ChannelService implements IChannelService {

	private LjwChannelTDAO ljwChannelTDAO;

	public void setLjwChannelTDAO(LjwChannelTDAO ljwChannelTDAO) {
		this.ljwChannelTDAO = ljwChannelTDAO;
	}

	public void addChannel(LjwChannelT Channel) throws SystemException {
		ljwChannelTDAO.save(Channel);

	}

	public void delChannel(LjwChannelT Channel) throws SystemException {
		ljwChannelTDAO.delete(Channel);

	}

	public LjwChannelT getChannelInfoByid(Integer id) throws SystemException {
		// TODO Auto-generated method stub
		return ljwChannelTDAO.findById(id);
	}

	public PageBean getChannelList(LjwChannelT Channel, PageBean pageBean) {
		List list=ljwChannelTDAO.findAll();
		pageBean.setList(list);
		return pageBean;
	}

	public void modifyChannel(LjwChannelT Channel) throws SystemException {
		ljwChannelTDAO.merge(Channel);

	}

	public List getALlChannelByParentId(Integer parentId)
			throws SystemException {
		// TODO Auto-generated method stub
		return ljwChannelTDAO.findAllByParentId(parentId);
	}
	
	

}
